package com.pig4cloud.pigx.contract.mongo.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.pig4cloud.pigx.common.customize.contants.MongoTableNameConstants;
import com.pig4cloud.pigx.common.customize.utils.serializer.BigDecimalToPlainStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 币对表mongodb实体类
 *
 * @date 2022/8/12 14:21
 */
@Data
@Document(MongoTableNameConstants.CONTRACT_SYMBOL)
public class ContractSymbolMongo implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@Id
	private Long id;

	/**
	 * 主币id
	 */
	private Long mainCurId;

	/**
	 * 主币名称
	 */
	private String mainCurName;

	/**
	 * 主币精度
	 */
	private Integer mainCurAccuracy;

	/**
	 * 外币id
	 */
	private Long tokenCurId;

	/**
	 * 外币名称
	 */
	private String tokenCurName;

	/**
	 * 外币精度
	 */
	private Integer tokenCurAccuracy;

	/**
	 * 名称
	 */
	@Indexed(useGeneratedName = true)
	private String name;

	/**
	 * 最大杠杆倍数
	 */
	private Integer multiple;

	/**
	 * 市价单手续费费率
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal marketFeeRate;

	/**
	 * 限价单手续费费率
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal limitFeeRate;

	/**
	 * 资金费率
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal fundingRate;

	/**
	 * 资金费率上限
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal maxCapitalRate;

	/**
	 * 资金费率下限
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal minCapitalRate;

	/**
	 * 最小下单数量
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal minOrderNum;

	/**
	 * 最小下单价格
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal minOrderPrice;

	/**
	 * 市价单单笔最大数量
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal maxMarketOrderNum;

	/**
	 * 限价单单笔最大数量
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal maxLimitOrderNum;

	/**
	 * 最大挂单数量
	 */
	private Integer maxPendingOrderNum;

	/**
	 * 最大条件单挂单数量
	 */
	private Integer maxConditionPendingOrderNum;

	/**
	 * 最小价格波动单位
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal minPriceFloatUnit;

	/**
	 * 限价单价格上限比率
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal limitOrderPriceCapRatio;

	/**
	 * 限价单价格下限比率
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal limitOrderPriceFloorRatio;

	/**
	 * 是否是热点数据（0否、1是）
	 */
	private String isHot;

	/**
	 * 顺序号
	 */
	private Integer orderNo;

	/**
	 * 强平清算费率
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal liquidateFeeRate;

	/**
	 * 强平提前量
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal liquidateAdvance;

	/**
	 * 状态(0停用 1正常)
	 */
	private String status;

	/**
	 * 币对logo地址
	 */
	private String logoImg;

	/**
	 * 标记价
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal markPrice;
	/**
	 * 指数价
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal indexPrice;
	/**
	 * 最新价
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal lastPrice;
	/**
	 * 涨跌幅
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal riseAndFallRange;

	/**
	 * 24h 成交额
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal sumPrice;

	/**
	 * 24h 最高价
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal maxPrice;

	/**
	 * 24h 最低价
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal minPrice;

	/**
	 * 24h 成交量
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal sumNum;

	/**
	 * 空方人数
	 */
	private Integer emptyCount;

	/**
	 * 多方人数
	 */
	private Integer moreCount;

	/**
	 * 空方持仓量(币本位)
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal emptyNum;

	/**
	 * 多方持仓量(币本位)
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal moreNum;

	/**
	 * 是否删除（null是、0否）
	 */
	private String isDeleted;

	/**
	 * 张数
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal sheet;

}
